LL COMP Functions ¶
Configuration of comparator modes ¶
- group COMP_LL_EF_Configuration_comparator_modes
-
Functions
-
void
LL_COMP_SetPowerMode
(
COMP_TypeDef
*
p_comp
,
uint32_t
power_mode
)
¶
-
Set comparator instance operating mode to adjust power and speed.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 PWRMODE LL_COMP_SetPowerMode
- Parameters :
-
p_comp – Comparator instance.
power_mode – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetPowerMode
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator instance operating mode to adjust power and speed.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 PWRMODE LL_COMP_GetPowerMode
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
-
void
LL_COMP_SetPowerMode
(
COMP_TypeDef
*
p_comp
,
uint32_t
power_mode
)
¶
- group COMP_LL_EF_Configuration_comparator_modes
-
Functions
-
void
LL_COMP_SetPowerMode
(
COMP_TypeDef
*
p_comp
,
uint32_t
power_mode
)
-
Set comparator instance operating mode to adjust power and speed.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 PWRMODE LL_COMP_SetPowerMode
- Parameters :
-
p_comp – Comparator instance.
power_mode – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetPowerMode
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator instance operating mode to adjust power and speed.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 PWRMODE LL_COMP_GetPowerMode
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
-
void
LL_COMP_SetPowerMode
(
COMP_TypeDef
*
p_comp
,
uint32_t
power_mode
)
- group COMP_LL_EF_Configuration_comparator_modes
-
Functions
-
void
LL_COMP_SetPowerMode
(
COMP_TypeDef
*
p_comp
,
uint32_t
power_mode
)
-
Set comparator instance operating mode to adjust power and speed.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 PWRMODE LL_COMP_SetPowerMode
- Parameters :
-
p_comp – Comparator instance.
power_mode – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetPowerMode
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator instance operating mode to adjust power and speed.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 PWRMODE LL_COMP_GetPowerMode
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
-
void
LL_COMP_SetPowerMode
(
COMP_TypeDef
*
p_comp
,
uint32_t
power_mode
)
Configuration of comparator inputs ¶
- group COMP_LL_EF_Configuration_comparator_inputs
-
Functions
-
void
LL_COMP_ConfigInputs
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
,
uint32_t
input_plus
)
¶
-
Set comparator inputs minus (inverting) and plus (non-inverting).
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_ConfigInputs
CFGR1 INMSEL LL_COMP_ConfigInputs
CFGR1 BRGEN LL_COMP_ConfigInputs
CFGR1 SCALEN LL_COMP_ConfigInputs
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
Note
On this STM32 series, a voltage scaler is used when COMP input is based on VrefInt (VrefInt or subdivision of VrefInt): Voltage scaler requires a delay for voltage stabilization. Refer to device datasheet, parameter “tSTART_SCALER”.
- Parameters :
-
p_comp – Comparator instance
input_minus – This parameter can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
input_plus – This parameter can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
void
LL_COMP_SetInputPlus
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_plus
)
¶
-
Set comparator input plus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_SetInputPlus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
input_plus – This parameter can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
uint32_t
LL_COMP_GetInputPlus
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator input plus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_GetInputPlus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
void
LL_COMP_SetInputMinus
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
)
¶
-
Set comparator input minus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INMSEL LL_COMP_SetInputMinus
CFGR1 BRGEN LL_COMP_SetInputMinus
CFGR1 SCALEN LL_COMP_SetInputMinus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
- Parameters :
-
p_comp – Comparator instance
input_minus – This parameter can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
-
uint32_t
LL_COMP_GetInputMinus
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator input minus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INMSEL LL_COMP_GetInputMinus
CFGR1 BRGEN LL_COMP_GetInputMinus
CFGR1 SCALEN LL_COMP_GetInputMinus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
-
uint32_t
LL_COMP_IsInputScalerEnabled
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator input voltage scaler bridge configuration.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 BRGEN LL_COMP_IsInputScalerEnabled
CFGR1 SCALEN LL_COMP_IsInputScalerEnabled
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of scaler bridge configuration (value “1” for enabled, value “0” for disabled).
-
void
LL_COMP_EnableInputTempSensorBuffer
(
COMP_TypeDef
*
p_comp
)
¶
-
Enable comparator input temperature sensor buffer.
- Reference Manual to LL API cross reference (Register Field Functions)
-
RCC_AHB2ENR AHB2ENR LL_COMP_EnableInputTempSensorBuffer
ADC_CCR TSEN LL_COMP_EnableInputTempSensorBuffer
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain. Caution: ADC clock domain reset or disable impacts temperature sensor.
Note
Temperature sensor stabilization delay must be fulfilled, refer to LL_ADC_DELAY_TEMPSENSOR_STAB_US (in ADC LL driver) or device datasheet. Delay encompassed in LL_COMP_DELAY_STARTUP_US and LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US, therefore no additional delay required for temperature sensor buffer.
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_DisableInputTempSensorBuffer
(
COMP_TypeDef
*
p_comp
)
¶
-
Disable comparator input temperature sensor buffer.
- Reference Manual to LL API cross reference (Register Field Functions)
-
ADC_CCR TSEN LL_COMP_DisableInputTempSensorBuffer
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain. Clock domain of ADC not reset to not interfere with potential ADC operation. Caution: Temperature sensor buffer disable must not be performed if ADC expected to convert channel temperature sensor.
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsInputTempSensorBufferEnabled
(
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator input temperature sensor buffer configuration.
- Reference Manual to LL API cross reference (Register Field Functions)
-
ADC_CCR TSEN LL_COMP_IsInputTempSensorBufferEnabled
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain.
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_SetInputHysteresis
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_hysteresis
)
¶
-
Set comparator input hysteresis.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 HYST LL_COMP_SetInputHysteresis
Note
Hysteresys applied on comparator input minus.
- Parameters :
-
p_comp – Comparator instance
input_hysteresis – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetInputHysteresis
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator instance hysteresis mode of the minus (inverting) input.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 HYST LL_COMP_GetInputHysteresis
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
Functions
-
void
LL_COMP_SetOutputPolarity
(
COMP_TypeDef
*
p_comp
,
uint32_t
output_polarity
)
¶
-
Set comparator instance output polarity.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 POLARITY LL_COMP_SetOutputPolarity
- Parameters :
-
p_comp – Comparator instance
output_polarity – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetOutputPolarity
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator instance output polarity.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 POLARITY LL_COMP_GetOutputPolarity
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
-
void
LL_COMP_SetOutputBlankingSource
(
COMP_TypeDef
*
p_comp
,
uint32_t
blanking_source
)
¶
-
Set comparator instance blanking source.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR BLANKING LL_COMP_SetOutputBlankingSource
Note
Availability of parameters of blanking source from peripherals depends on their availability on the selected device.
Note
Blanking source can be specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
blanking_source – This parameter can be one of the following values:
LL_COMP_BLANKINGSRC_TIM8_OC6 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT6 (3)
LL_COMP_BLANKINGSRC_TIM2_OC4 (3)
LL_COMP_BLANKINGSRC_TIM3_OC3 (3)
LL_COMP_BLANKINGSRC_TIM3_OC4 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT7 (3)
-
uint32_t
LL_COMP_GetOutputBlankingSource
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator instance blanking source.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR BLANKING LL_COMP_GetOutputBlankingSource
Note
Availability of parameters of blanking source from peripherals depends on their availability on the selected device.
Note
Blanking source can be specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_BLANKINGSRC_TIM8_OC6 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT6 (3)
LL_COMP_BLANKINGSRC_TIM2_OC4 (3)
LL_COMP_BLANKINGSRC_TIM3_OC3 (3)
LL_COMP_BLANKINGSRC_TIM3_OC4 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT7 (3)
Functions
-
void
LL_COMP_Enable
(
COMP_TypeDef
*
p_comp
)
¶
-
Enable comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_Enable
Note
After enable, comparator requires a delay to reach reach propagation delay specification, refer to LL_COMP_DELAY_STARTUP_US.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US. To get scaler bridge configuration, refer to LL_COMP_IsInputScalerEnabled().
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_Disable
(
COMP_TypeDef
*
p_comp
)
¶
-
Disable comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_Disable
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsEnabled
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator enable state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_IsEnabled
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Value – “0” for comparator disabled, value “1” for comparator enabled.
-
void
LL_COMP_Lock
(
COMP_TypeDef
*
p_comp
)
¶
-
Lock comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 LOCK LL_COMP_Lock
Note
Once locked, comparator configuration can be accessed in read-only.
Note
The only way to unlock the comparator is a device system reset.
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsLocked
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator lock state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 LOCK LL_COMP_IsLocked
Note
Once locked, comparator configuration can be accessed in read-only.
Note
The only way to unlock the comparator is a device system reset.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Value – “0” for comparator unlocked, value “1” for comparator locked.
-
uint32_t
LL_COMP_ReadOutputLevel
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Read comparator instance output level.
- Reference Manual to LL API cross reference (Register Field Functions)
-
SR C1VAL LL_COMP_ReadOutputLevel
Note
The comparator output level depends on the selected polarity (Refer to function LL_COMP_SetOutputPolarity()). If the comparator polarity is not inverted:
Comparator output is low when the input plus is at a lower voltage than the input minus
Comparator output is high when the input plus is at a higher voltage than the input minus If the comparator polarity is inverted:
Comparator output is high when the input plus is at a lower voltage than the input minus
Comparator output is low when the input plus is at a higher voltage than the input minus
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
Functions
-
uint32_t
LL_COMP_IsActiveFlag_OutputTrig
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator output trigger flag (latched).
- Reference Manual to LL API cross reference (Register Field Functions)
-
SR C1IF LL_COMP_IsActiveFlag_OutputTrig
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of bit (1 or 0).
-
void
LL_COMP_ClearFlag_OutputTrig
(
COMP_TypeDef
*
p_comp
)
¶
-
Clear comparator comparator output trigger flag (latched).
- Reference Manual to LL API cross reference (Register Field Functions)
-
ICFR CC1IF LL_COMP_ClearFlag_OutputTrig
- Parameters :
-
p_comp – Comparator instance
Functions
-
void
LL_COMP_EnableIT_OutputTrig
(
COMP_TypeDef
*
p_comp
)
¶
-
Enable comparator output trigger interrupt.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_EnableIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_DisableIT_OutputTrig
(
COMP_TypeDef
*
p_comp
)
¶
-
Disable comparator output trigger interrupt.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_DisableIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsEnabledIT_OutputTrig
(
const
COMP_TypeDef
*
p_comp
)
¶
-
Get comparator output trigger interrupt state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_IsEnabledIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of bit (1 or 0).
-
void
LL_COMP_ConfigInputs
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
,
uint32_t
input_plus
)
¶
- group COMP_LL_EF_Configuration_comparator_inputs
-
Functions
-
void
LL_COMP_ConfigInputs
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
,
uint32_t
input_plus
)
-
Set comparator inputs minus (inverting) and plus (non-inverting).
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_ConfigInputs
CFGR1 INMSEL LL_COMP_ConfigInputs
CFGR1 BRGEN LL_COMP_ConfigInputs
CFGR1 SCALEN LL_COMP_ConfigInputs
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
Note
On this STM32 series, a voltage scaler is used when COMP input is based on VrefInt (VrefInt or subdivision of VrefInt): Voltage scaler requires a delay for voltage stabilization. Refer to device datasheet, parameter “tSTART_SCALER”.
- Parameters :
-
p_comp – Comparator instance
input_minus – This parameter can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
input_plus – This parameter can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
void
LL_COMP_SetInputPlus
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_plus
)
-
Set comparator input plus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_SetInputPlus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
input_plus – This parameter can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
uint32_t
LL_COMP_GetInputPlus
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator input plus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_GetInputPlus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
void
LL_COMP_SetInputMinus
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
)
-
Set comparator input minus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INMSEL LL_COMP_SetInputMinus
CFGR1 BRGEN LL_COMP_SetInputMinus
CFGR1 SCALEN LL_COMP_SetInputMinus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
- Parameters :
-
p_comp – Comparator instance
input_minus – This parameter can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
-
uint32_t
LL_COMP_GetInputMinus
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator input minus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INMSEL LL_COMP_GetInputMinus
CFGR1 BRGEN LL_COMP_GetInputMinus
CFGR1 SCALEN LL_COMP_GetInputMinus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
-
uint32_t
LL_COMP_IsInputScalerEnabled
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator input voltage scaler bridge configuration.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 BRGEN LL_COMP_IsInputScalerEnabled
CFGR1 SCALEN LL_COMP_IsInputScalerEnabled
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of scaler bridge configuration (value “1” for enabled, value “0” for disabled).
-
void
LL_COMP_EnableInputTempSensorBuffer
(
COMP_TypeDef
*
p_comp
)
-
Enable comparator input temperature sensor buffer.
- Reference Manual to LL API cross reference (Register Field Functions)
-
RCC_AHB2ENR AHB2ENR LL_COMP_EnableInputTempSensorBuffer
ADC_CCR TSEN LL_COMP_EnableInputTempSensorBuffer
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain. Caution: ADC clock domain reset or disable impacts temperature sensor.
Note
Temperature sensor stabilization delay must be fulfilled, refer to LL_ADC_DELAY_TEMPSENSOR_STAB_US (in ADC LL driver) or device datasheet. Delay encompassed in LL_COMP_DELAY_STARTUP_US and LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US, therefore no additional delay required for temperature sensor buffer.
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_DisableInputTempSensorBuffer
(
COMP_TypeDef
*
p_comp
)
-
Disable comparator input temperature sensor buffer.
- Reference Manual to LL API cross reference (Register Field Functions)
-
ADC_CCR TSEN LL_COMP_DisableInputTempSensorBuffer
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain. Clock domain of ADC not reset to not interfere with potential ADC operation. Caution: Temperature sensor buffer disable must not be performed if ADC expected to convert channel temperature sensor.
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsInputTempSensorBufferEnabled
(
COMP_TypeDef
*
p_comp
)
-
Get comparator input temperature sensor buffer configuration.
- Reference Manual to LL API cross reference (Register Field Functions)
-
ADC_CCR TSEN LL_COMP_IsInputTempSensorBufferEnabled
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain.
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_SetInputHysteresis
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_hysteresis
)
-
Set comparator input hysteresis.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 HYST LL_COMP_SetInputHysteresis
Note
Hysteresys applied on comparator input minus.
- Parameters :
-
p_comp – Comparator instance
input_hysteresis – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetInputHysteresis
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator instance hysteresis mode of the minus (inverting) input.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 HYST LL_COMP_GetInputHysteresis
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
Functions
-
void
LL_COMP_SetOutputPolarity
(
COMP_TypeDef
*
p_comp
,
uint32_t
output_polarity
)
-
Set comparator instance output polarity.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 POLARITY LL_COMP_SetOutputPolarity
- Parameters :
-
p_comp – Comparator instance
output_polarity – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetOutputPolarity
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator instance output polarity.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 POLARITY LL_COMP_GetOutputPolarity
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
-
void
LL_COMP_SetOutputBlankingSource
(
COMP_TypeDef
*
p_comp
,
uint32_t
blanking_source
)
-
Set comparator instance blanking source.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR BLANKING LL_COMP_SetOutputBlankingSource
Note
Availability of parameters of blanking source from peripherals depends on their availability on the selected device.
Note
Blanking source can be specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
blanking_source – This parameter can be one of the following values:
LL_COMP_BLANKINGSRC_TIM8_OC6 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT6 (3)
LL_COMP_BLANKINGSRC_TIM2_OC4 (3)
LL_COMP_BLANKINGSRC_TIM3_OC3 (3)
LL_COMP_BLANKINGSRC_TIM3_OC4 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT7 (3)
-
uint32_t
LL_COMP_GetOutputBlankingSource
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator instance blanking source.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR BLANKING LL_COMP_GetOutputBlankingSource
Note
Availability of parameters of blanking source from peripherals depends on their availability on the selected device.
Note
Blanking source can be specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_BLANKINGSRC_TIM8_OC6 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT6 (3)
LL_COMP_BLANKINGSRC_TIM2_OC4 (3)
LL_COMP_BLANKINGSRC_TIM3_OC3 (3)
LL_COMP_BLANKINGSRC_TIM3_OC4 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT7 (3)
Functions
-
void
LL_COMP_Enable
(
COMP_TypeDef
*
p_comp
)
-
Enable comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_Enable
Note
After enable, comparator requires a delay to reach reach propagation delay specification, refer to LL_COMP_DELAY_STARTUP_US.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US. To get scaler bridge configuration, refer to LL_COMP_IsInputScalerEnabled().
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_Disable
(
COMP_TypeDef
*
p_comp
)
-
Disable comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_Disable
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsEnabled
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator enable state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_IsEnabled
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Value – “0” for comparator disabled, value “1” for comparator enabled.
-
void
LL_COMP_Lock
(
COMP_TypeDef
*
p_comp
)
-
Lock comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 LOCK LL_COMP_Lock
Note
Once locked, comparator configuration can be accessed in read-only.
Note
The only way to unlock the comparator is a device system reset.
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsLocked
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator lock state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 LOCK LL_COMP_IsLocked
Note
Once locked, comparator configuration can be accessed in read-only.
Note
The only way to unlock the comparator is a device system reset.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Value – “0” for comparator unlocked, value “1” for comparator locked.
-
uint32_t
LL_COMP_ReadOutputLevel
(
const
COMP_TypeDef
*
p_comp
)
-
Read comparator instance output level.
- Reference Manual to LL API cross reference (Register Field Functions)
-
SR C1VAL LL_COMP_ReadOutputLevel
Note
The comparator output level depends on the selected polarity (Refer to function LL_COMP_SetOutputPolarity()). If the comparator polarity is not inverted:
Comparator output is low when the input plus is at a lower voltage than the input minus
Comparator output is high when the input plus is at a higher voltage than the input minus If the comparator polarity is inverted:
Comparator output is high when the input plus is at a lower voltage than the input minus
Comparator output is low when the input plus is at a higher voltage than the input minus
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
Functions
-
uint32_t
LL_COMP_IsActiveFlag_OutputTrig
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator output trigger flag (latched).
- Reference Manual to LL API cross reference (Register Field Functions)
-
SR C1IF LL_COMP_IsActiveFlag_OutputTrig
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of bit (1 or 0).
-
void
LL_COMP_ClearFlag_OutputTrig
(
COMP_TypeDef
*
p_comp
)
-
Clear comparator comparator output trigger flag (latched).
- Reference Manual to LL API cross reference (Register Field Functions)
-
ICFR CC1IF LL_COMP_ClearFlag_OutputTrig
- Parameters :
-
p_comp – Comparator instance
Functions
-
void
LL_COMP_EnableIT_OutputTrig
(
COMP_TypeDef
*
p_comp
)
-
Enable comparator output trigger interrupt.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_EnableIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_DisableIT_OutputTrig
(
COMP_TypeDef
*
p_comp
)
-
Disable comparator output trigger interrupt.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_DisableIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsEnabledIT_OutputTrig
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator output trigger interrupt state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_IsEnabledIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of bit (1 or 0).
-
void
LL_COMP_ConfigInputs
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
,
uint32_t
input_plus
)
- group COMP_LL_EF_Configuration_comparator_inputs
-
Functions
-
void
LL_COMP_ConfigInputs
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
,
uint32_t
input_plus
)
-
Set comparator inputs minus (inverting) and plus (non-inverting).
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_ConfigInputs
CFGR1 INMSEL LL_COMP_ConfigInputs
CFGR1 BRGEN LL_COMP_ConfigInputs
CFGR1 SCALEN LL_COMP_ConfigInputs
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
Note
On this STM32 series, a voltage scaler is used when COMP input is based on VrefInt (VrefInt or subdivision of VrefInt): Voltage scaler requires a delay for voltage stabilization. Refer to device datasheet, parameter “tSTART_SCALER”.
- Parameters :
-
p_comp – Comparator instance
input_minus – This parameter can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
input_plus – This parameter can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
void
LL_COMP_SetInputPlus
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_plus
)
-
Set comparator input plus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_SetInputPlus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
input_plus – This parameter can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
uint32_t
LL_COMP_GetInputPlus
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator input plus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INPSEL LL_COMP_GetInputPlus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_INPUT_PLUS_OPAMP1_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP2_OUT (3)(4)
LL_COMP_INPUT_PLUS_OPAMP3_OUT (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH1 (3)(4)
LL_COMP_INPUT_PLUS_DAC2_CH2 (4)
-
void
LL_COMP_SetInputMinus
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
)
-
Set comparator input minus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INMSEL LL_COMP_SetInputMinus
CFGR1 BRGEN LL_COMP_SetInputMinus
CFGR1 SCALEN LL_COMP_SetInputMinus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
- Parameters :
-
p_comp – Comparator instance
input_minus – This parameter can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
-
uint32_t
LL_COMP_GetInputMinus
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator input minus.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 INMSEL LL_COMP_GetInputMinus
CFGR1 BRGEN LL_COMP_GetInputMinus
CFGR1 SCALEN LL_COMP_GetInputMinus
Note
In case of comparator input selected to be connected to IO: GPIO pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_INPUT_MINUS_DAC2_CH1 (3)
LL_COMP_INPUT_MINUS_DAC2_CH2 (3)(4)
-
uint32_t
LL_COMP_IsInputScalerEnabled
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator input voltage scaler bridge configuration.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 BRGEN LL_COMP_IsInputScalerEnabled
CFGR1 SCALEN LL_COMP_IsInputScalerEnabled
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of scaler bridge configuration (value “1” for enabled, value “0” for disabled).
-
void
LL_COMP_EnableInputTempSensorBuffer
(
COMP_TypeDef
*
p_comp
)
-
Enable comparator input temperature sensor buffer.
- Reference Manual to LL API cross reference (Register Field Functions)
-
RCC_AHB2ENR AHB2ENR LL_COMP_EnableInputTempSensorBuffer
ADC_CCR TSEN LL_COMP_EnableInputTempSensorBuffer
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain. Caution: ADC clock domain reset or disable impacts temperature sensor.
Note
Temperature sensor stabilization delay must be fulfilled, refer to LL_ADC_DELAY_TEMPSENSOR_STAB_US (in ADC LL driver) or device datasheet. Delay encompassed in LL_COMP_DELAY_STARTUP_US and LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US, therefore no additional delay required for temperature sensor buffer.
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_DisableInputTempSensorBuffer
(
COMP_TypeDef
*
p_comp
)
-
Disable comparator input temperature sensor buffer.
- Reference Manual to LL API cross reference (Register Field Functions)
-
ADC_CCR TSEN LL_COMP_DisableInputTempSensorBuffer
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain. Clock domain of ADC not reset to not interfere with potential ADC operation. Caution: Temperature sensor buffer disable must not be performed if ADC expected to convert channel temperature sensor.
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsInputTempSensorBufferEnabled
(
COMP_TypeDef
*
p_comp
)
-
Get comparator input temperature sensor buffer configuration.
- Reference Manual to LL API cross reference (Register Field Functions)
-
ADC_CCR TSEN LL_COMP_IsInputTempSensorBufferEnabled
Note
Specific configuration with bitfields out of comparator registers due to temperature sensor buffer controlled by ADC clock domain.
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_SetInputHysteresis
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_hysteresis
)
-
Set comparator input hysteresis.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 HYST LL_COMP_SetInputHysteresis
Note
Hysteresys applied on comparator input minus.
- Parameters :
-
p_comp – Comparator instance
input_hysteresis – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetInputHysteresis
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator instance hysteresis mode of the minus (inverting) input.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 HYST LL_COMP_GetInputHysteresis
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
Functions
-
void
LL_COMP_SetOutputPolarity
(
COMP_TypeDef
*
p_comp
,
uint32_t
output_polarity
)
-
Set comparator instance output polarity.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 POLARITY LL_COMP_SetOutputPolarity
- Parameters :
-
p_comp – Comparator instance
output_polarity – This parameter can be one of the following values:
-
uint32_t
LL_COMP_GetOutputPolarity
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator instance output polarity.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 POLARITY LL_COMP_GetOutputPolarity
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
-
void
LL_COMP_SetOutputBlankingSource
(
COMP_TypeDef
*
p_comp
,
uint32_t
blanking_source
)
-
Set comparator instance blanking source.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR BLANKING LL_COMP_SetOutputBlankingSource
Note
Availability of parameters of blanking source from peripherals depends on their availability on the selected device.
Note
Blanking source can be specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
blanking_source – This parameter can be one of the following values:
LL_COMP_BLANKINGSRC_TIM8_OC6 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT6 (3)
LL_COMP_BLANKINGSRC_TIM2_OC4 (3)
LL_COMP_BLANKINGSRC_TIM3_OC3 (3)
LL_COMP_BLANKINGSRC_TIM3_OC4 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT7 (3)
-
uint32_t
LL_COMP_GetOutputBlankingSource
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator instance blanking source.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR BLANKING LL_COMP_GetOutputBlankingSource
Note
Availability of parameters of blanking source from peripherals depends on their availability on the selected device.
Note
Blanking source can be specific to each comparator instance. Refer to description of parameters or to reference manual.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
LL_COMP_BLANKINGSRC_TIM8_OC6 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT6 (3)
LL_COMP_BLANKINGSRC_TIM2_OC4 (3)
LL_COMP_BLANKINGSRC_TIM3_OC3 (3)
LL_COMP_BLANKINGSRC_TIM3_OC4 (3)
LL_COMP_BLANKINGSRC_PLAY_OUT7 (3)
Functions
-
void
LL_COMP_Enable
(
COMP_TypeDef
*
p_comp
)
-
Enable comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_Enable
Note
After enable, comparator requires a delay to reach reach propagation delay specification, refer to LL_COMP_DELAY_STARTUP_US.
Note
Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). In this case, specific delay must be fulfilled for voltage stabilization when enabling comparator, refer to LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US. To get scaler bridge configuration, refer to LL_COMP_IsInputScalerEnabled().
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_Disable
(
COMP_TypeDef
*
p_comp
)
-
Disable comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_Disable
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsEnabled
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator enable state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 EN LL_COMP_IsEnabled
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Value – “0” for comparator disabled, value “1” for comparator enabled.
-
void
LL_COMP_Lock
(
COMP_TypeDef
*
p_comp
)
-
Lock comparator instance.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 LOCK LL_COMP_Lock
Note
Once locked, comparator configuration can be accessed in read-only.
Note
The only way to unlock the comparator is a device system reset.
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsLocked
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator lock state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 LOCK LL_COMP_IsLocked
Note
Once locked, comparator configuration can be accessed in read-only.
Note
The only way to unlock the comparator is a device system reset.
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Value – “0” for comparator unlocked, value “1” for comparator locked.
-
uint32_t
LL_COMP_ReadOutputLevel
(
const
COMP_TypeDef
*
p_comp
)
-
Read comparator instance output level.
- Reference Manual to LL API cross reference (Register Field Functions)
-
SR C1VAL LL_COMP_ReadOutputLevel
Note
The comparator output level depends on the selected polarity (Refer to function LL_COMP_SetOutputPolarity()). If the comparator polarity is not inverted:
Comparator output is low when the input plus is at a lower voltage than the input minus
Comparator output is high when the input plus is at a higher voltage than the input minus If the comparator polarity is inverted:
Comparator output is high when the input plus is at a lower voltage than the input minus
Comparator output is low when the input plus is at a higher voltage than the input minus
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
Returned – value can be one of the following values:
Functions
-
uint32_t
LL_COMP_IsActiveFlag_OutputTrig
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator output trigger flag (latched).
- Reference Manual to LL API cross reference (Register Field Functions)
-
SR C1IF LL_COMP_IsActiveFlag_OutputTrig
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of bit (1 or 0).
-
void
LL_COMP_ClearFlag_OutputTrig
(
COMP_TypeDef
*
p_comp
)
-
Clear comparator comparator output trigger flag (latched).
- Reference Manual to LL API cross reference (Register Field Functions)
-
ICFR CC1IF LL_COMP_ClearFlag_OutputTrig
- Parameters :
-
p_comp – Comparator instance
Functions
-
void
LL_COMP_EnableIT_OutputTrig
(
COMP_TypeDef
*
p_comp
)
-
Enable comparator output trigger interrupt.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_EnableIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
-
void
LL_COMP_DisableIT_OutputTrig
(
COMP_TypeDef
*
p_comp
)
-
Disable comparator output trigger interrupt.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_DisableIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
-
uint32_t
LL_COMP_IsEnabledIT_OutputTrig
(
const
COMP_TypeDef
*
p_comp
)
-
Get comparator output trigger interrupt state.
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 ITEN LL_COMP_IsEnabledIT_OutputTrig
- Parameters :
-
p_comp – Comparator instance
- Return values :
-
State – of bit (1 or 0).
-
void
LL_COMP_ConfigInputs
(
COMP_TypeDef
*
p_comp
,
uint32_t
input_minus
,
uint32_t
input_plus
)
Configuration of COMP hierarchical scope: ¶
Note
This section is not available for STM32C562xx.
Note
This section is not available for STM32C5A3xx.
- group COMP_LL_EF_Configuration_comparator_common
-
common to several COMP instances
Functions
-
void
LL_COMP_SetCommonWindowMode
(
COMP_Common_TypeDef
*
p_comp_common
,
uint32_t
window_mode
)
¶
-
Set window mode of a pair of comparators instances (2 consecutive COMP instances COMP<x> and COMP<x+1>).
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 WINMODE LL_COMP_SetCommonWindowMode
- Parameters :
-
p_comp_common – Comparator common instance (can be set directly from CMSIS definition or by using helper macro LL_COMP_COMMON_INSTANCE() )
window_mode – This parameter can be one of the following values:
LL_COMP_WINDOW_INPUT_PLUS_EVEN Note: Parameters values with suffix odd or even can also be selected from comparator instance using helper macro LL_COMP_WINDOW_INST_TO_INPUT_PLUS.
-
uint32_t
LL_COMP_GetCommonWindowMode
(
const
COMP_Common_TypeDef
*
p_comp_common
)
¶
-
Get window mode of a pair of comparators instances (2 consecutive COMP instances COMP<x> and COMP<x+1>).
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 WINMODE LL_COMP_GetCommonWindowMode
- Parameters :
-
p_comp_common – Comparator common instance (can be set directly from CMSIS definition or by using helper macro LL_COMP_COMMON_INSTANCE()).
- Return values :
-
Returned – value can be one of the following values:
-
void
LL_COMP_SetCommonWindowOutput
(
COMP_Common_TypeDef
*
p_comp_common
,
uint32_t
window_output
)
¶
-
Set window output of a pair of comparators instances (2 consecutive COMP instances COMP<x> and COMP<x+1>).
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 WINOUT LL_COMP_SetCommonWindowOutput
- Parameters :
-
p_comp_common – Comparator common instance (can be set directly from CMSIS definition or by using helper macro LL_COMP_COMMON_INSTANCE() ).
window_output – This parameter can be one of the following values:
LL_COMP_WINDOW_OUTPUT_XOR_BOTH Note: Parameters values with suffix odd or even can also be selected from comparator instance using helper LL_COMP_WINDOW_INST_TO_OUTPUT.
-
uint32_t
LL_COMP_GetCommonWindowOutput
(
const
COMP_Common_TypeDef
*
p_comp_common
)
¶
-
Get window output of a pair of comparators instances (2 consecutive COMP instances COMP<x> and COMP<x+1>).
- Reference Manual to LL API cross reference (Register Field Functions)
-
CFGR1 WINOUT LL_COMP_GetCommonWindowOutput
- Parameters :
-
p_comp_common – Comparator common instance (can be set directly from CMSIS definition or by using helper macro LL_COMP_COMMON_INSTANCE()).
- Return values :
-
Returned – value can be one of the following values:
-
void
LL_COMP_SetCommonWindowMode
(
COMP_Common_TypeDef
*
p_comp_common
,
uint32_t
window_mode
)
¶